package middleware

import (
	"ruoyi-go-echo-ddd/internal/infrastructure/http/request"

	"github.com/labstack/echo/v4"
)

// ValidatorMiddleware 验证处理中间件
func ValidatorMiddleware() echo.MiddlewareFunc {
	return func(next echo.HandlerFunc) echo.HandlerFunc {
		return func(c echo.Context) error {
			err := next(c)
			request.HandlerValidatorErr(c, err)
			return err
		}
	}
}
